import { BorrowQueryList, BorrowQuery } from "@/type";
import qs from "qs";
import request from "@/utils/request";

export async function getBorrowList(params?: BorrowQueryList) {
    // const res = await axios(`https://mock.apifox.cn/m1/2398938-0-default/api/Borrows?${qs.stringify(params)}`)
    return request.get(`/api/borrows?${qs.stringify(params)}`)
}

export async function BorrowAdd(params?: BorrowQuery) {
    return request.post('/api/borrows', params);
}

export async function BorrowDelete(id?: string) {
    return request.delete(`/api/borrows/${id}`);
}

export async function getBorrowDetail(id?: string) {
    return request.get(`/api/borrows/${id}`);
}

export async function BorrowUpdate(params?: BorrowQuery) {
    return request.put(`/api/borrows`, params);
}